hysop.core.graph.computational_node_frontend module

class hysop.core.graph.computational_node_frontend.ComputationalGraphNodeFrontend(implementation=None, base_kwds=None, candidate_input_tensors=None, candidate_output_tensors=None, **impl_kwds)[source]

Bases: ComputationalGraphNodeGenerator

Initialize a ComputationalGraphNodeFrontend

Parameters:
  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • impl_kwds – Keywords arguments that will be passed towards implementation implemention __init__.

implementation

the implementation key

Type:

Implementation

backend

the backend corresponding to implementation

Type:

Backend

impl

the implementation class

Type:

ComputationalGraphNodeGenerator or ComputationalGraphNode

impl_kwds

Keywords arguments that will be passed towards implementation implemention impl.__init__ during a call to _generate.

classmethod available_implementations()[source]

Return all available implementations.

abstract default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

dump_inputs(**kwds)[source]

Tell the generated operator to dump some of its inputs before apply is called.

Target folder, file, dump frequency and other io pameters are passed trough io_params or as keywords.

See hysop.core.computational_node.ComputationalGraphNode.dump_inputs().

dump_outputs(**kwds)[source]

Tell the generated operator to dump some of its outputs after apply is called.

Target folder, file, dump frequency and other io pameters are passed trough instance io_params of this parameter or as keywords.

See hysop.core.computational_node.ComputationalGraphNode.dump_outputs().

abstract implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.

class hysop.core.graph.computational_node_frontend.MultiComputationalGraphNodeFrontend(implementation_key, implementation=None, **kwds)[source]

Bases: ComputationalGraphNodeFrontend

Interface like ComputationalGraphNodeFrontend that handles multiple different discretization methods: IMPLEMENTATION_KEY + IMPLEMENTATION => OPERATOR (ComputationalGraphNodeFrontend only generates OPERATOR from IMPLEMENTATION).

Initialize a MultiComputationalGraphNodeFrontend

Parameters:
  • implementation_key (object) – Target implementation method. Should be contained in available_implementation_keys().

  • implementation (Implementation, optional, defaults to None) – Target implementation, should be contained in available_implementations()[implementation_key]. If None, implementation will be set to default_implementation().

  • kwds (dict) – Base class keyword arguments.

implementation_key

Target implementation method.

Type:

object

abstract all_default_implementations()[source]

Return the default Implementation for each method. The return type is a dictionnary (method -> default_implementation).

abstract all_implementations()[source]

Return all implementations of a certain method as a dictionnary. Keys are the methods and values are dictionnaries of (implementation -> operator).

classmethod available_implementation_keys()[source]

Return all available implementation methods.

available_implementations()[source]

Return all available implementations.

default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

property implementation_key
implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.